﻿using System;
using System.Collections.Generic;

using System.Text;
using GGSharp.Structures;

namespace GGSharp.Packets
{
    public class AddNotifyPacket : HeaderPacket
    {
        private NotifyStruct _notifyStruct = new NotifyStruct();

        public AddNotifyPacket()
        {
            this.Type = PacketType.GG_ADD_NOTIFY;
            this.Length = 5;
        }

        public AddNotifyPacket(NotifyStruct notify)
            : this()
        {
            _notifyStruct = notify;
        }

        public AddNotifyPacket(int uin)
            : this()
        {
            _notifyStruct.Number = uin;
        }

        public NotifyStruct Notify
        {
            get { return _notifyStruct; }
            protected set { _notifyStruct = value; }
        }

        public override void Read(System.IO.BinaryReader reader)
        {
            base.Read(reader);

            _notifyStruct.Read(reader);
        }

        public override void Write(System.IO.BinaryWriter writer)
        {
            base.Write(writer);

            _notifyStruct.Write(writer);
        }
    }
}
